// src/APP.vue

<template>
  <input v-focus />
</template>

<script lang="ts">

export default {
  name: 'APP',
  directives: { //局部自定义指令
    focus: {
      mounted(el) {
        el.focus()
      }
    }
  }
}
</script>